import request from '@/utils/request'

//通过角色查询用户信息
export function getUserByRole(id) {
	return request({
		method: 'get',
		url: 'tbSysUserRole/queryByRoleId/' + id,
		headers: {
			userButton: '7d692e924db5441b8bba20aed83ef604'
		}
	})
}

//通过用户查询角色信息
export function getRoleByUser(id) {
	return request({
		method: 'get',
		url: 'tbSysUserRole/queryByUserId/' + id,
		headers: {
			userButton: 'cf05f9aa8c0146ca9fb268c8afd06b86'
		}
	})
}

//给单个角色添加多个相同的用户
export function addUsersByRole(data) {
	return request({
		method: 'post',
		url: 'tbSysUserRole/addForRole',
		headers: {
			userButton: 'b70d5278616d484ea7f5d6324013dce0'
		},
		data
	})
}

//给单个用户添加多个相同角色
export function addRolesByUser(data) {
	return request({
		method: 'post',
		url: 'tbSysUserRole/addForUser',
		headers: {
			userButton: '17e111df25d84aa4a929eaa281a2812c'
		},
		data
	})
}

//获取用户 - 通过角色类型
export function queryUserRoleByType(data) {
	return request({
		method: 'post',
		url: 'tbSysUserRole/queryUserRoleType',
		headers: {
			userButton: 'bd360e5ff5d241b4ab593b53f34c03a3'
		},
		data
	})
}

//获取用户
export function queryUserRoleByType3(data) {
	return request({
		method: 'post',
		url: 'tbSysUserRole/queryUserRoleType3',
		headers: {
			userButton: 'bd360e5ff5d241b4ab593b53f34c03a3'
		},
		data
	})
}